import {
  getInviteCodeApi,
  getArticleListApi,
  getCategoryApi,
  saveArticleApi,
  articleDetailApi,
  sendCommentApi,
  commentListApi,
  doLikeApi,
  articleLikeApi
} from './api/api.js'

export const store = {
  namespaced: true,
  state: {
  },
  mutations: {

  },
  actions: {
    GET_INVITE_CODE: ({ commit, state }, params) => {
      return getInviteCodeApi().then(res => {
      })
    },
    GET_ARTICLE_LIST: ({ commit, state }, params) => {
      return getArticleListApi(params)
    },
    GET_CATEGORY: ({ commit, state }, params) => {
      return getCategoryApi(params)
    },
    SAVE_ARTICLE: ({ commit, state }, params) => {
      return saveArticleApi(params)
    },
    GET_DETAIL: ({ commit, state }, params) => {
      return articleDetailApi(params)
    },
    SEND_COMMENT: ({ commit, state }, params) => {
      return sendCommentApi(params)
    },
    COMMENT_LIST: ({ commit, state }, params) => {
      return commentListApi(params)
    },
    DO_LIKE: ({ commit, state }, params) => {
      return doLikeApi(params)
    },
    ARTICLE_LIKE: ({ commit, state }, params) => {
      return articleLikeApi(params)
    }
  }
}
